﻿using AutoMapper;

namespace GroceryPriceBook.Core.Mappers
{
	/// <summary>
	/// View Model object for presentation which inherits the AutoMapper Profile class
	/// </summary>
	public class ProductManufacturer : Profile
	{
		public override string ProfileName
		{
			get { return "ProductManufacturerMappings"; }
		}

		protected override void Configure()
		{
			Mapper.CreateMap<Model.ProductMaker, ViewModel.ProductManufacturer>();
			Mapper.CreateMap<ViewModel.ProductManufacturer, Model.ProductMaker>()
				  .ForSourceMember(src => src.Products, opt => opt.Ignore());
		}
	}
}
